Skip to content

Improve prover setup#112

Merged
RogerPodacter merged 4 commits into
evm-backend-demofrom
improve_prover
Sep 24, 2025
Merged

Improve prover setup#112
RogerPodacter merged 4 commits into
evm-backend-demofrom
improve_prover

Conversation

@RogerPodacter

Copy link
Copy Markdown
Member

No description provided.

cursor[bot]

This comment was marked as outdated.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the Ethscriptions prover system from immediate proving to a batched approach. The change improves efficiency by queueing ethscriptions during block operations and flushing them in batches at block boundaries.

  • Replaces immediate proveEthscriptionData calls with a queue-and-flush mechanism
  • Integrates L1Block contract to trigger batch flushes at the start of each new block
  • Updates test suite to verify batched proving behavior and removes failure handling tests that are no longer applicable

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
contracts/src/EthscriptionsProver.sol Implements batched proving with queue management and L1Block-triggered flushing
contracts/src/Ethscriptions.sol Switches from immediate proving to queueing ethscriptions for batch processing
contracts/src/L2/L1Block.sol Adds flush trigger at block boundaries to process queued proofs
contracts/test/EthscriptionsProver.t.sol Updates tests to verify batched proving functionality
contracts/test/EthscriptionsFailureHandling.t.sol Removes failure handling tests as they're no longer applicable with the new design

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread contracts/src/EthscriptionsProver.sol Outdated
delete queuedProofInfo[txHash];
}

emit ProofBatchFlushed(count, block.number - 1);

Copilot AI Sep 24, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The event emits block.number - 1 which could underflow if block.number is 0. Consider using a safer approach or documenting why this subtraction is safe in this context.

Suggested change
emit ProofBatchFlushed(count, block.number - 1);
emit ProofBatchFlushed(count, block.number > 0 ? block.number - 1 : 0);

Copilot uses AI. Check for mistakes.
Comment on lines +243 to +244
// Decode the data to get the count (first uint256 in data)
proofCount = abi.decode(logs[i].data, (uint256));

Copilot AI Sep 24, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment indicates this decodes the count as the first uint256 in data, but the ProofBatchFlushed event signature shows it has two parameters (count, blockNumber). This should decode both values or clarify which specific parameter is being extracted.

Suggested change
// Decode the data to get the count (first uint256 in data)
proofCount = abi.decode(logs[i].data, (uint256));
// Decode the data to get the count (first uint256 in data, second is blockNumber)
(uint256 count, ) = abi.decode(logs[i].data, (uint256, uint256));
proofCount = count;

Copilot uses AI. Check for mistakes.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread contracts/src/EthscriptionsProver.sol Outdated
/// @param ethscriptionTxHash The transaction hash of the ethscription
function proveEthscriptionData(bytes32 ethscriptionTxHash) external virtual {
/// @param proofInfo The queued proof info containing block data
function _createAndSendProof(bytes32 ethscriptionTxHash, QueuedProof storage proofInfo) internal {

Copilot AI Sep 24, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proofInfo parameter should be passed by value (memory) instead of by reference (storage) since it's only being read and doesn't need to be modified. Using storage unnecessarily keeps a reference to storage which is less gas efficient for read-only operations.

Copilot uses AI. Check for mistakes.
Comment thread contracts/test/EthscriptionsProver.t.sol Outdated
cursor[bot]

This comment was marked as outdated.

RogerPodacter and others added 2 commits September 24, 2025 13:25
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@RogerPodacter RogerPodacter merged commit b7f39cd into evm-backend-demo Sep 24, 2025
2 checks passed
@RogerPodacter RogerPodacter deleted the improve_prover branch September 24, 2025 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants